import request from '@/utils/request'

const BASE_URL = '/admin/system/sysLetter';

export default {
    findPageInfo(page, limit, searchObj) {
        return request({
            url: `${BASE_URL}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },


    addLetter(sysLetter) {
        return request({
            url: `${BASE_URL}/addLetter`,
            method: 'post',
            data: sysLetter
        })
    },

    findLetterById(id) {
        return request({
            url: `${BASE_URL}/findLetterById/${id}`,
            method: 'get',

        })
    },

    updateLetter(sysLetter) {
        return request({
            url: `${BASE_URL}/updateLetter`,
            method: 'post',
            data: sysLetter
        })
    },

    removeById(id) {
        return request({
            url: `${BASE_URL}/removeLetterById/${id}`,
            method: 'delete',

        })
    },
    //  7、批量删除
    batchremoveId(ids) {
        return request({
            url: `${BASE_URL}/removeLetterByIds`,
            method: 'delete',  // 提交方式
            data: ids
        })
    },

    // 8、更改信件来源
    updateLetterOrigin(id, origin) {
        return request({
            url: `${BASE_URL}/updateLetterOrigin/${id}/${origin}`,
            method: 'get'
        })
    },
}